package com.dhcc.dubbo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import com.alibaba.dubbo.spring.boot.annotation.EnableDubboConfiguration;
import com.dhcc.dubbo.bean.response.Result;
import com.dhcc.dubbo.controller.UserController;

@SpringBootApplication
@EnableDubboConfiguration
public class DubboClientApplication {
	public static void main(String[] args) {
		// 入口运行类
		ConfigurableApplicationContext run = SpringApplication.run(DubboClientApplication.class, args);
		UserController bean = run.getBean(UserController.class);
		Result allUsers = bean.getAllUsers(10);
		System.out.println(allUsers);

		Result user = bean.getUserByUserName("zhangsan");
		System.out.println(user);
	}
}